﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using FTchina.Library;

/// <summary>
///BasePage 的摘要说明
/// </summary>
public class BasePage : Page
{
    public BasePage()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    protected override void OnLoad(EventArgs e)
    {
        
        //LogHelper.Debug("OnLoad");
        base.OnLoad(e);
    }

    protected override void OnInit(EventArgs e)
    {
        string rrbot=RequestHelper.GetRequst("ROBOTKEY");
        string configkey=System.Configuration.ConfigurationManager.AppSettings["ROBOTKEY"].ToString();

        if ((rrbot != configkey))
        {//判断是不是定时机器人
            MasterHelper.CheckLogin();//检查登录
            MasterHelper.ChkPoewr("/" + RequestHelper.GetCurrentPagePath().Replace("action", ""));//检查路径
        }
        
         base.OnInit(e);
    }

    protected override void OnError(EventArgs e)
    {
        LogHelper.Error(RequestHelper.GetCurrentPagePath()+"*****"+Server.GetLastError().Message);
        base.OnError(e);
    }

     
}